<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">基本信息</h4>
</div>
<div class="modal-body">
    <table class="detailTable table table-hover table-striped table-bordered">
        <c:if test="${leaderCheck.operateType==2}">
            <tr>
                <th></th>
                <th>原数据</th>
                <th>新数据</th>
            </tr>
        </c:if>


        <tr>
            <th>
                姓　　名：
            </th>
            <td>${data.name}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.name}</td>
            </c:if>
        </tr>
        <tr>
            <th>
                身份证号：
            </th>
            <td>${data.idCard}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.idCard}</td>
            </c:if>
        </tr>
        <tr>
            <th>
                手机号码：
            </th>
            <td>${data.phone}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.phone}</td>
            </c:if>
        </tr>
        <tr>
            <th>
                出生日期：
            </th>
            <td><fmt:formatDate value="${data.birthday}" pattern="yyyy-MM-dd"/></td>
            <c:if test="${leaderCheck.operateType==2}">
                <td ><fmt:formatDate value="${newData.birthday}" pattern="yyyy-MM-dd"/></td>
            </c:if>
        </tr>
        <tr>
            <th>
                性　　别：
            </th>
            <td>
                <c:choose>
                    <c:when test="${data.sex==0}">女</c:when>
                    <c:when test="${data.sex==1}">男</c:when>
                </c:choose>
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <c:choose>
                        <c:when test="${newData.sex==0}">女</c:when>
                        <c:when test="${newData.sex==1}">男</c:when>
                    </c:choose>
                </td>
            </c:if>
        </tr>
        <tr>
            <th>
                电子邮件：
            </th>
            <td>${data.email}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.email}</td>
            </c:if>
        </tr>
        <tr>
            <th>
                银行卡号：
            </th>
            <td>${data.bankCard}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.bankCard}</td>
            </c:if>
        </tr>

        <tr>
            <th>
                开&nbsp;&nbsp;户&nbsp;&nbsp;行：
            </th>
            <td>${data.bankName}</td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>${newData.bankName}</td>
            </c:if>
        </tr>
        <tr>
            <th>
                状　　态：
            </th>
            <td>
                <c:choose>
                    <c:when test="${data.retire==0}">在职</c:when>
                    <c:when test="${data.retire==1}">退休</c:when>
                </c:choose>
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <c:choose>
                        <c:when test="${newData.retire==0}">在职</c:when>
                        <c:when test="${newData.retire==1}">退休</c:when>
                    </c:choose>
                </td>
            </c:if>
        </tr>
        <tr>
            <th>
                是否教师：
            </th>
            <td>
                <c:choose>
                    <c:when test="${data.teacher==0}">不是</c:when>
                    <c:when test="${data.teacher==1}">是</c:when>
                </c:choose>
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <c:choose>
                        <c:when test="${newData.teacher==0}">不是</c:when>
                        <c:when test="${newData.teacher==1}">是</c:when>
                    </c:choose>
                </td>
            </c:if>
        </tr>
        <tr>
            <th>
                是否外省：
            </th>
            <td>
                <c:choose>
                    <c:when test="${data.outLander==0}">省内</c:when>
                    <c:when test="${data.outLander==1}">省外</c:when>
                </c:choose>
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <c:choose>
                        <c:when test="${newData.outLander==0}">省内</c:when>
                        <c:when test="${newData.outLander==1}">省外</c:when>
                    </c:choose>
                </td>
            </c:if>
        </tr>
        <tr>
            <th>
                最高学历：
            </th>
            <td>
                <c:choose>
                    <c:when test="${data.education==0}">博士</c:when>
                    <c:when test="${data.education==1}">博士研究生</c:when>
                    <c:when test="${data.education==2}">硕士</c:when>
                    <c:when test="${data.education==3}">硕士研究生</c:when>
                    <c:when test="${data.education==4}">本科</c:when>
                    <c:when test="${data.education==5}">大专</c:when>
                    <c:when test="${data.education==6}">中专</c:when>
                    <c:when test="${data.education==7}">高中</c:when>
                </c:choose>
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <c:choose>
                        <c:when test="${newData.education==0}">博士</c:when>
                        <c:when test="${newData.education==1}">博士研究生</c:when>
                        <c:when test="${newData.education==2}">硕士</c:when>
                        <c:when test="${newData.education==3}">硕士研究生</c:when>
                        <c:when test="${newData.education==4}">本科</c:when>
                        <c:when test="${newData.education==5}">大专</c:when>
                        <c:when test="${newData.education==6}">中专</c:when>
                        <c:when test="${newData.education==7}">高中</c:when>
                    </c:choose>
                </td>
            </c:if>
        </tr>
        <tr>
            <th>
                职　　称：
            </th>
            <td>
                <c:choose>
                    <c:when test="${data.rank==0}">正高</c:when>
                    <c:when test="${data.rank==1}">副高</c:when>
                    <c:when test="${data.rank==2}">硕士</c:when>
                    <c:when test="${data.rank==3}">中级</c:when>
                    <c:when test="${data.rank==4}">其他</c:when>
                </c:choose>
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <c:choose>
                        <c:when test="${newData.rank==0}">正高</c:when>
                        <c:when test="${newData.rank==1}">副高</c:when>
                        <c:when test="${newData.rank==2}">硕士</c:when>
                        <c:when test="${newData.rank==3}">中级</c:when>
                        <c:when test="${newData.rank==4}">其他</c:when>
                    </c:choose>
                </td>
            </c:if>
        </tr>
        <tr>
            <th>
                是否启用：
            </th>
            <td>
                <c:choose>
                    <c:when test="${data.live==0}">停用</c:when>
                    <c:when test="${data.live==1}">启用</c:when>

                </c:choose>
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <c:choose>
                        <c:when test="${newData.live==0}">停用</c:when>
                        <c:when test="${newData.live==1}">启用</c:when>
                    </c:choose>
                </td>
            </c:if>
        </tr>
        <tr>
            <th>
                照　　片：
            </th>
            <td>
                <img style="height: 110px;min-width: 170px" class="img-thumbnail"
                <c:choose>
                     <c:when test="${data.headImg!=null}">src="downloadFileByPath?pathName=${data.headImg}"</c:when>
                     <c:otherwise>alt=" 无头像……"</c:otherwise>
                </c:choose>
                >
            </td>
            <c:if test="${leaderCheck.operateType==2}">
                <td>
                    <img style="height: 110px;min-width: 170px" class="img-thumbnail"
                    <c:choose>
                         <c:when test="${newData.headImg!=null}">src="downloadFileByPath?pathName=${newData.headImg}"</c:when>
                         <c:otherwise>alt=" 无头像……"</c:otherwise>
                    </c:choose>
                    >
                </td>
            </c:if>
        </tr>


    </table>
</div>


<script>
    $.each($(".detailTable tr"), function (i, v) {
        var tds=  $(this).find("td");
        if (tds.length==2&&tds[0].innerText.trim()!=tds[1].innerText.trim()){
            $(this).find("td").css("color","red");
        }
    })
</script>



